package Draw;

import Chess.BorderPane;
import javafx.scene.paint.Color;


public class blackpawn {
	int cellent = 90; 
	public void blackpawn(int x,int y,int[][] chess){
		 Color color = new Color(0,0,0,0.5);	
		try{
		if(chess[y+1][x+1]==1){
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect((x+1)*cellent, (y+1)*cellent, cellent, cellent);
		}
		}
		catch(Exception ex){
			
		}
		try {
			 if(chess[y+1][x-1]==1){
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect((x-1)*cellent, (y+1)*cellent, cellent, cellent);
		}
		}catch(Exception ex){
			
		}
		       
		if(chess[y+1][x]!=2&&chess[y+1][x]!=1){
			if(y==1&&chess[y+2][x]!=2&&chess[y+2][x]!=1){
				for(int i = y+1;i<=y+2;i++){
					BorderPane.gc.setFill(color);
					BorderPane.gc.fillRect(x*cellent, i*cellent, cellent, cellent);
				}
			}
			else{
			BorderPane.gc.setFill(color);
			BorderPane.gc.fillRect(x*cellent, (y+1)*cellent, cellent, cellent);
			}
		
			
		}
	}	
}
